import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";

var _class;

function _templateObject2() {
  var data = _taggedTemplateLiteral(["\n  padding: 12px 0;\n  flex: 1;\n  display: flex;\n  justify-content: center;\n  img {\n    width: 32px;\n    height: 32px;\n  }\n"]);

  _templateObject2 = function _templateObject2() {
    return data;
  };

  return data;
}

function _templateObject() {
  var data = _taggedTemplateLiteral([""]);

  _templateObject = function _templateObject() {
    return data;
  };

  return data;
}

import React from "react";
import styled from "styled-components"; // import { Spin } from "../../index";

import { BlockContainer } from "./index.style";
import SectionTitle from "../_components/SectionTitle";
import ConfigItem from "../_components/ConfigItem";
import loading1 from "../../assets/icons/cpaas-loading2.gif";
import loading2 from "../../assets/icons/cpaas-loading.gif";
import withFormOperate from "../_components/withFormOperate";
var StyledConfigItem = styled(ConfigItem)(_templateObject());
var LoadingWrapper = styled.div(_templateObject2());
var loadings = [{
  render: React.createElement(LoadingWrapper, null, React.createElement("img", {
    src: loading1,
    alt: "loading"
  }))
}, {
  render: React.createElement(LoadingWrapper, null, React.createElement("img", {
    src: loading2,
    alt: "loading"
  }))
}];

var LoadingConfig = withFormOperate(_class = /*#__PURE__*/function (_React$Component) {
  _inherits(LoadingConfig, _React$Component);

  function LoadingConfig() {
    _classCallCheck(this, LoadingConfig);

    return _possibleConstructorReturn(this, _getPrototypeOf(LoadingConfig).apply(this, arguments));
  }

  _createClass(LoadingConfig, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
          handleChange = _this$props.handleChange,
          schema = _this$props.schema,
          value = _this$props.value;
      loadings[0].bottomTitle = "S".concat(schema, "\u6A21\u5F0F\u4E0B\uFF0C\u63A8\u8350\u4F7F\u7528\u8BE5\u6837\u5F0F");
      return React.createElement(BlockContainer, {
        id: "loading-config"
      }, React.createElement(SectionTitle, {
        title: "\u52A0\u8F7D",
        titleTail: "Loading"
      }), React.createElement(StyledConfigItem, {
        cols: 4,
        items: loadings,
        onChange: handleChange("spin"),
        defaultSelected: value
      }));
    }
  }]);

  return LoadingConfig;
}(React.Component)) || _class;

export { LoadingConfig as default };
